import request from '@/utils/request'

// -------------------------------------------------------------------------------------采购申请接口文档----------------------------------------------------------------------------

// 获取采购申请列表---------------------------------------- 
export function list (params) {
  return request({
    url: '/function/purchase/list',
    method: 'get',
    params
  })
}

// 重新申请接口---------------------------------------
export function resubmit (id) {
  return request({
    url: '/function/purchase/reapply/' + id,
    method: 'post',
  })
}

// 获取采购申请列表详情 ==> 三个页面全部通用 ----------------------------------------
export function listDetail (id) {
  return request({
    url: '/function/purchase/' + id,
    method: 'get',
  })
}

// 审核流程  ==> 三个页面全部通用 ----------------------------
export function auditDatail (params) {
  return request({
    url: '/function/audit/purchase/list',
    method: 'get',
    params
  })
}

//添加采购品：获取备件耗材列表----------------------------------------
export function replacementList (params) {
  return request({
    // url: '/function/consumable/base/purchase/list',
    url: '/function/consumable/base/priceAndAmount/list',
    method: 'get',
    params
  })
}

//添加采购品：获取设备基值列表----------------------------------------
export function equipmentList (params) {
  return request({
    url: '/function/equipment/base/list',
    method: 'get',
    params
  })
}
//添加采购品：获取用户列表----------------------------------------
export function getuserlist (data) {
  return request({
    url: '/system/user/list',
    method: 'get',
    params: data
  })
}
//添加采购品: 提交接口----------------------------------------
export function add (data) {
  return request({
    url: '/function/purchase',
    method: 'post',
    data
  })
}

// -------------------------------------------------------------------------------------与我相关接口文档----------------------------------------------------------------------------

// 获取与我相关列表----------------------------------------
export function listAndMe (params) {
  return request({
    url: '/function/purchase/my/list',
    method: 'get',
    params
  })
}

// 审核接口---------------------------------------
export function statusSort (data) {
  return request({
    url: '/function/audit/purchase',
    method: 'put',
    data
  })
}

// -------------------------------------------------------------------------------------采购明细接口文档----------------------------------------------------------------------------

// 获取采购明细（设备）列表----------------------------------------
export function listpPrchasea (params) {
  return request({
    url: '/function/purchase/equipment/detail/list',
    method: 'get',
    params
  })
}
// 获取采购明细（物料）列表----------------------------------------
export function listpPrchases (params) {
  return request({
    url: '/function/purchase/consumable/detail/list',
    method: 'get',
    params
  })
}

// // 获取采购明细（物料）列表----------------------------------------
// export function listpPrchases (params) {
//   return request({
//     url: '/function/purchase/consumable/detail/list',
//     method: 'get',
//     params
//   })
// }
